<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>查看</title>
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<!-- bower:css -->
<link rel="stylesheet" href="/common/js/kityminder-editor/bower_components/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="/common/js/kityminder-editor/bower_components/codemirror/lib/codemirror.css" />
<link rel="stylesheet" href="/common/js/kityminder-editor/bower_components/kityminder-core/dist/kityminder.core.css" />
<link rel="stylesheet" href="/common/js/kityminder-editor/bower_components/color-picker/dist/color-picker.min.css" />
<!-- endbower -->
<link rel="stylesheet" href="/common/js/kityminder-editor/kityminder.editor.min.css">
<style>
	html, body {
		margin: 0;
		padding: 0;
		height: 100%;
		overflow: hidden;
	}
	h1.editor-title {
		background: #393F4F;
		color: white;
		margin: 0;
		height: 40px;
		font-size: 14px;
		line-height: 40px;
		font-family: 'Hiragino Sans GB', 'Arial', 'Microsoft Yahei';
		font-weight: normal;
		padding: 0 20px;
	}
	div.minder-editor-container {
		position: absolute;
		top:0px;
		bottom: 0;
		left: 0;
		right: 0;
	}
	.diy{
		margin-top:0px;
		float:right;
		background-color: #fff;
		min-width: 60px;
		text-decoration: none;
		color: #999;
		padding: 0 10px;
		border: none;
		border-right: 1px solid #ccc;
		cursor: pointer;
	}
	.minder-editor {top:0px;}
</style>
</head>
<body>
	<div ng-app="kityminderDemo" ng-controller="MainController">
		<kityminder-editor on-init="initEditor(editor, minder)"></kityminder-editor>
	</div>
</body>

<!-- bower:js -->
<script src="/common/js/kityminder-editor/bower_components/jquery/dist/jquery.js"></script>
<script src="/common/js/kityminder-editor/bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="/common/js/kityminder-editor/bower_components/angular/angular.js"></script>
<script src="/common/js/kityminder-editor/bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="/common/js/kityminder-editor/bower_components/codemirror/lib/codemirror.js"></script>
<script src="/common/js/kityminder-editor/bower_components/codemirror/mode/xml/xml.js"></script>
<script src="/common/js/kityminder-editor/bower_components/codemirror/mode/javascript/javascript.js"></script>
<script src="/common/js/kityminder-editor/bower_components/codemirror/mode/css/css.js"></script>
<script src="/common/js/kityminder-editor/bower_components/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script src="/common/js/kityminder-editor/bower_components/codemirror/mode/markdown/markdown.js"></script>
<script src="/common/js/kityminder-editor/bower_components/codemirror/addon/mode/overlay.js"></script>
<script src="/common/js/kityminder-editor/bower_components/codemirror/mode/gfm/gfm.js"></script>
<script src="/common/js/kityminder-editor/bower_components/angular-ui-codemirror/ui-codemirror.js"></script>
<script src="/common/js/kityminder-editor/bower_components/marked/lib/marked.js"></script>
<script src="/common/js/kityminder-editor/bower_components/kity/dist/kity.min.js"></script>
<script src="/common/js/kityminder-editor/bower_components/hotbox/hotbox.js"></script>
<script src="/common/js/kityminder-editor/bower_components/json-diff/json-diff.js"></script>
<script src="/common/js/kityminder-editor/bower_components/kityminder-core/dist/kityminder.core.min.js"></script>
<script src="/common/js/kityminder-editor/bower_components/color-picker/dist/color-picker.min.js"></script>
<!-- endbower -->

<script src="/common/js/kityminder-editor/kityminder.editor.view.js"></script>

<script>
	var  json = window.params || {
        "root": {
            "data": {
                "text": "中心主题"
            }
        }
    } ;
    console.log(json);
	var content = JSON.stringify(json) ;
	angular.module('kityminderDemo', ['kityminderEditor'])
			.config(function (configProvider) {
				//配置项，只支持ctrlPanelMin, ctrlPanelWidth, dividerWidth, defaultLang, zoom, imageUpload
				//configProvider.set('imageUpload', './server/imageUpload.php');
			})
			.controller('MainController', function($scope) {
				
				$scope.initEditor = function(editor, minder) {
					window.editor = editor;
					window.minder = minder;
					
					//读取数据
					editor.minder.importData('json', content).then(function(data){
						//禁止编辑
						minder.disable() ;
						$(".km-note").remove();
						$("#minder-toolbar").remove();
						
					});
				};
			});
</script>
</html>